
import cv2
if __name__=='__main__':
    image=cv2.imread("C:\\Users\\20436\Desktop\jianpan.jpg")
    image_gray=cv2.cvtColor(
        image,
        cv2.COLOR_BGR2GRAY
    )
    _,image_thresh=cv2.threshold(
        image_gray,
        127,
        255,
        cv2.THRESH_BINARY+cv2.THRESH_OTSU
    )


    edges_image=cv2.Canny(
        image_thresh,
        15,
        25
    )

    cv2.imshow('edges_image',edges_image)
    cv2.imshow('image_thresh', image_thresh)
    cv2.imwrite('edges_image.jpg', edges_image)
    cv2.waitKey(0)